From 1191aa9d1988c469844eb4545689617a8b13eae1 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 11 May 2015 10:37:58 +0200 Subject: [PATCH] x86: don't clear high 32 bits of RAX on sub-word guest I/O port reads 1- or 2-byte operations never alter the high halves of registers. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- xen/arch/x86/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 22cdfc48ae..4b42b2d20a 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -2238,7 +2238,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs) if ( op_bytes == 4 ) regs->eax = 0; else - regs->eax &= ~((1u << (op_bytes * 8)) - 1); + regs->eax &= ~((1 << (op_bytes * 8)) - 1); regs->eax |= guest_io_read(port, op_bytes, v, regs); } bpmatch = check_guest_io_breakpoint(v, port, op_bytes); -- 2.30.2